package com.ruoyi.system.Fdongbei.service.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.Fdongbei.domain.dto.ZidonghuaYanDto;
import com.ruoyi.system.Fdongbei.service.ITbGuozhongLiuchengService;
import com.ruoyi.system.Fdongbei.service.ITbZidongHuayanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service

public class TbZidongHuayanServiceImpl  implements ITbZidongHuayanService {


    @Resource
    ITbGuozhongLiuchengService iTbGuozhongLiuchengService;



    @Override
    @DataSource(value = DataSourceType.LY002_D)
    public int UploadDetectionResults(ZidonghuaYanDto zidonghuaYanDto) {

        // 处理接收到的数据
        int testerID = zidonghuaYanDto.getTesterID();
        String cata = zidonghuaYanDto.getData().getDataInner().getCata();
        String samplingNo = zidonghuaYanDto.getData().getDataInner().getSamplingNo();
        List<ZidonghuaYanDto.Data.DataInner.TestResult> testResultList = zidonghuaYanDto.getData().getDataInner().getTestResultList();


        return 0;
    }


    public String zzks_logic(String ypks,String zzks,String ymqybsm){
        String hth =  iTbGuozhongLiuchengService.selecthth(ymqybsm);
        if(!hth.isEmpty()){
            return "未查询到合同号";

        }
        Double BB1 = Double.parseDouble(ypks);//样品克数
        Double AA1 = Double.parseDouble(zzks);//杂质克数
        Double BB0 = AA1 / BB1 * 100;//计算杂志率

        return "";
    }



}
